import { createStore, compose, applyMiddleware } from 'redux'
import reducers from '../reducers'
// 中间介用来做异步操作
import thunkMiddleware from 'redux-thunk'
export default function (initState) {
  return createStore(reducers, initState, compose(
    applyMiddleware(thunkMiddleware), window.__REDUX_DEVTOOLS_EXTENSION__
    && window.__REDUX_DEVTOOLS_EXTENSION__())
  )
}

// window.__REDUX_DEVTOOLS_EXTENSION__
// && window.__REDUX_DEVTOOLS_EXTENSION__()